#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>
int main(){
    pid_t pid=fork();
    int con=5;
    if(pid==0){
        while(1){
        printf("child pid=%d,ppid=%d\n",getpid(),getppid());
    sleep(1);
        }
    }else{
        while(con){
            printf("parent pid=%d,ppid=%d\n",getpid(),getppid());
            con--;
            sleep(1);
        }
    }
    return 0;
}
